package com.alvis.media.viewmodel.admin.user;

import lombok.Data;
import com.alvis.media.domain.UserEventLog; // 导入对应的实体类
import com.alvis.media.utility.DateTimeUtil; // 如需时间格式化可导入

@Data
public class UserEventLogVM {

    private Integer id;

    private Integer userId;

    private String userName;

    private String realName;

    private String content;

    private String createTime;

    // 添加from方法，用于实体转VM
    public static UserEventLogVM from(UserEventLog userEventLog) {
        // 若使用modelMapper可直接映射
        UserEventLogVM vm = new UserEventLogVM();
        vm.setId(userEventLog.getId());
        vm.setUserId(userEventLog.getUserId());
        vm.setUserName(userEventLog.getUserName());
        vm.setRealName(userEventLog.getRealName());
        vm.setContent(userEventLog.getContent());
        // 如需格式化时间，参考UserResponseVM的处理方式
        vm.setCreateTime(DateTimeUtil.dateFormat(userEventLog.getCreateTime()));
        return vm;
    }

}
